<!--
 作者 : 唐梓元
 日期 : 2019-6-27
 版本 : 1.0
 描述 :首页最新入库
 使用 : <cmHeader :searchShow="true"></cmHeader>
 参数 :searchShow 默认是'false'，值为FALSE的时候显示正常导航，搜索框隐藏
 -->


<template>
  <div class="newList  f" >
    <div class="listWrapper" v-for="(item,index) in newList" :key="index" :class="isFather" v-if="newList&&newList.length>0" @click.stop="do_goSubjectDetail(item)">
      <div class="listBgImg relt f-tb" >
        <div class="overflow3 " style="width: 100%;text-align: center" v-if="item.Title" v-text="item.Title">xxxxxxx富商大贾</div>
        <!--<div class="overflow3 " style="width: 100%;text-align: center" v-text="item.title">xxxxxxx富商大贾</div>-->
        <!--<div class="overflow3 " style="width: 100%;text-align: center" v-text="item.title2">xxxxxxx</div>-->
        <span class="abs" v-text="item.Subject">初中化学</span>
      </div>
      <ul>
        <li class="f"><div>完成人员：</div> <div class="flex1 overflow3" ><span v-if="item.Author" v-for="(item2,index2) in item.Author.split(',')" :key="index2">{{item2}}</span></div></li>
        <li class="f"><div>所属单位：</div> <div class="flex1 overflow3" ><span v-text="item.WorkUnitName">112</span></div></li>
        <li class="f"><div>课程来源：</div> <div class="flex1 overflow3" ><span v-text="item.EvaluationOrigin">112</span></div></li>
      </ul>
    </div>
    <div v-if="newList&&newList.length==0" class="noKeyWord ">
      暂无相关推荐！
    </div>
  </div>
</template>

<script>
    export default {
        name: "latestWarehousing",
      inject:['reload'],
      props:{
        newList:Array,
        isFather:String
      },
      watch:{
        newList(newV,oldV){
          this.newList.forEach((item,index)=>{
            if(item.title){
              this.$set(item,"Title",item.title)
            }
            if(item.FinishMan){
              this.$set(item,"Author",item.FinishMan)
            }
          })
        }
      },
      methods:{
        do_goSubjectDetail(item){
          if(this.isFather){
            this.$router.replace({name:"yw_subjectDetail",query:{SN:item.SN}})
            this.reload()
          }else {

            this.$router.push({name:"yw_subjectDetail",query:{SN:item.SN}})
          }

        }
      }

    }
</script>

<style scoped>
  .listWrapper{
    cursor: pointer;
    width: 385px;
    box-sizing: border-box;
    /*border: 1px solid;*/
    background-color: white;
    padding-bottom: 5px;
    box-shadow: 1px 1px 1px 1px #f3f3f3;
    margin:11px 22px 11px 0;
  }
  .listWrapper:nth-of-type(3n){
    margin-right:0px;
  }
  .listWrapper .listBgImg{
    height: 200px;
    width: 100%;
    background: url("../../assets/Home/lanse.png") center no-repeat;
    background-size: 100% 100%;
    margin-bottom: 20px;
  }
  .listWrapper:nth-of-type(2) .listBgImg,.listWrapper:nth-of-type(5) .listBgImg{
    background: url("../../assets/Home/huangse.png") center no-repeat ;
    background-size: 100% 100%;
  }
  .listWrapper:nth-of-type(3n) .listBgImg{
    background: url("../../assets/Home/fense.png") center no-repeat ;
    background-size: 100% 100%;
  }
  .listWrapper ul li{
    height: 30px;
    line-height: 30px;
    padding-left: 5px;
    color: #6A6A6A;
  }
  .listWrapper ul li span{
    padding: 0 5px;
  }
  .listBgImg div{
    color: white;
    font-size: 18px;
  }
  .listBgImg .abs{
    right: 0;
    top: 0;
    padding: 2px 9px;
    background-color: rgba(0,0,0,.7);
    color: white;
  }
  .newList{
    flex-wrap: wrap;
  }
  .isDetail{
    width: 280px !important;
    margin: 10px  !important;
  }
  .isDetail .listBgImg{
    height: 110px;
    width: 100%;
    background: url("../../assets/Home/lanse.png") center no-repeat;
    background-size: 100% 100%;
    margin-bottom: 20px;

  }
  .noKeyWord{
    min-height: 80px;
    color: grey;
    text-align: center;
    width: 100%;
   line-height: 80px;
  }
</style>
